import serial
import pyaudio

if __name__ == '__main__':
    port = "COM1"
    bps = 500000
    ser = serial.Serial(port, bps)

    p = pyaudio.PyAudio()

    stream = p.open(format= pyaudio.paInt16, 
                                  channels=1,
                                  rate=48000,
                                  output=True)

    while True:
        frame = bytes()
        frame += b'\x80'
        frame += ser.read()
        stream.write(frame)

